home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac-Source 1994 July
/
Mac-Source_July_1994.iso
/
C and C++
/
Text⁄Files
/
File List 14
/
About.c
< prev
next >
Wrap
Text File
|
1990-09-14
|
3KB
|
110 lines
/*
FilList 1.4
"About.c"
*/
#include "Main.h"
#include "Utilities.h"
#include "About.h"
extern short DlgFont: 0xAFA;
#define APPL 128 /* ID of application 'ICN#' */
#define AboutDialog 128 /* About ... */
#define AboutOk 1
#define AboutText 2
#define AboutIcon 3
#define AboutFc 4
#define AboutFm 5
#define AboutVc 6
#define AboutVm 7
#define AboutRc 8
#define AboutRm 9
#define AboutHp 10
#define AboutIs 17
#define AboutIm 19
#define AboutVersion2 20
#define AboutVersion1 21
#define AboutFrame 22
/* ----- Get long version message from 'vers' resource ----------------- */
static void SetVersion (
register DialogPtr dialog,
register short id,
register short item)
{
register Handle h;
register unsigned char *p;
if (h = GetResource('vers', id)) {
HLock(h);
p = (unsigned char *)*h;
p += 7 + p[6];
setText(dialog, item, p);
ReleaseResource(h);
}
}
/* ----- About File Lister ... ----------------------------------------- */
void DoAbout (
register short option,
register long heap)
{
register StringHandle IDStrHandle;
register unsigned char *s;
register DialogPtr dialog;
register long x;
short item;
/*short font;*/
static unsigned char Erny[] =
"\pErny Tontlinger (CIS 73720,2200)\r"
"33, route d'Arlon\r"
"L-8410 Steinfort Luxembourg";
s = Erny;
if (option & (optionKey | shiftKey | controlKey))
IDStrHandle = 0L;
else
if (IDStrHandle = (StringHandle)GetResource(Creator, 0)) {
HLock(IDStrHandle);
s = *IDStrHandle;
}
/*
font = DlgFont;
DlgFont = geneva;
*/
CenterDialog('DLOG', AboutDialog);
if (dialog = GetNewDialog(AboutDialog, 0L, -1L)) {
setText(dialog, AboutText, s);
setNumber(dialog, AboutFc, FileData.count);
setNumber(dialog, AboutFm, FileData.max);
setNumber(dialog, AboutVc, VolumeData.count);
setNumber(dialog, AboutVm, VolumeData.max);
setNumber(dialog, AboutIs, InfoSize);
setNumber(dialog, AboutIm, InfoMax);
setNumber(dialog, AboutHp, heap);
setNumber(dialog, AboutRc, InfoCount);
if (InfoCount) {
x = InfoSize/InfoCount;
if (InfoSize % InfoCount > InfoCount/2)
x++;
if (x) {
x = InfoMax/x;
setNumber(dialog, AboutRm, x);
}
}
SetVersion(dialog, 1, AboutVersion1);
SetVersion(dialog, 2, AboutVersion2);
SetUserItem(dialog, AboutIcon, (ProcPtr)DrawICN);
SetUserItem(dialog, AboutFrame, (ProcPtr)FrameItem);
ModalDialog(0L, &item);
DisposDialog(dialog);
}
/*DlgFont = font;*/
if (IDStrHandle)
ReleaseResource(IDStrHandle);
}